import { handleActions } from 'redux-actions'
import Enum from '../../constants/Enum'
import { CHANGE_METHOD } from '../types'

const getInitialState = () => ({
  type: Enum.addition,
  range: Enum.range_0_9
})

const initialState = getInitialState()

const reducer = {
  [CHANGE_METHOD]: (state, action) => {
    return {
      ...state,
      ...action.payload
    }
  }
}

export default handleActions(
  reducer,
  initialState
)
